In this part of the assignment we will modify time and pitch independently using the stft, which is historically often refered to as a "phase vocoder" in audio processing.
from a3py import *
import scipy as sp
def newfig(title=None):
fig = plt.figure(figsize=(12,3));
if(title is not None):
print(title)
fig.suptitle(title, fontsize=16);
audio_file_path = './noisyhellocs6682.wav';
a = Audio(audio_file_path);
print("Input Audio File {}:".format(audio_file_path));
a.play()
stft = STFT.FromAudio(a);
stft.show()
Input Audio File ./noisyhellocs6682.wav:
Here we will do an experiment where we compare what happens when we randomize the phases of an stft and take its istft to what happens if we randomize the magnitudes.
# You should finish the implementation of this part
window_size=1024;
hop_size = 128;
compareRandPhaseMag(a, window_size=window_size, hop_size=hop_size)
Unmodified ISTFT:
Original Phases, Random Magnitudes ISTFT:
Original Magnitudes, Random Phases ISTFT:
Write your answer below in this markdown cell... you don't need to write more than a few sentences for each.
How do smaller/larger window and hop sizes affect the importance of phase and magnitude?:
[Your answer here]
Hint: Remember our discussion of randomizing phase vs magnitude in the non-short time Fourier domain. What hop size and window size does this correspond to?